package com.ruoyi.yljf.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.yljf.mapper.BookCategoryMapper;
import com.ruoyi.yljf.domain.BookCategory;
import com.ruoyi.yljf.service.IBookCategoryService;

import javax.annotation.Resource;

/**
 * 书籍分类Service业务层处理
 * 
 * @author metaee
 * @date 2025-01-03
 */
@Service
public class BookCategoryServiceImpl extends ServiceImpl<BookCategoryMapper, BookCategory> implements IBookCategoryService {
    @Resource
    private BookCategoryMapper bookCategoryMapper;
    
    /**
     * 查询书籍分类列表
     * 
     * @param bookCategory 书籍分类
     * @return 书籍分类
     */
    @Override
    public List<BookCategory> selectBookCategoryList(BookCategory bookCategory) {
    	LambdaQueryWrapper<BookCategory> queryWrapper = Wrappers.lambdaQuery();
        if (StringUtils.isNotEmpty(bookCategory.getName())) {
			queryWrapper.like(BookCategory::getName, bookCategory.getName());
		}
        return bookCategoryMapper.selectList(queryWrapper);
    }
}
